onevent EVENT_DISPLAYREST
  ifvarg myshelly -1
  { getactor[myshelly].x x
    getactor[myshelly].y y
    getactor[myshelly].z z

    ifvare sector[sprite[myshelly].sectnum].lotag 2 subvar z 4096
    else ifvare sprite[myshelly].picnum SHELLYCROUCH subvar z 3072
    else ifvare sprite[myshelly].picnum DUKEBOTCROUCH subvar z 3072
    else subvar z 8192

    getactor[myshelly].ang angvar

    updatesectorz x y z tempb
    ifvarg tempb -1
      showviewunbiased x y z angvar 100 tempb 0 0 89 59
  }
endevent